//
//  XMGFriTrendViewController.m
//  BuDeJie19
//
//  Created by hjj on 2016/12/3.
//  Copyright © 2016年 hjjuny. All rights reserved.
//

#import "XMGFriTrendViewController.h"
#import "XMGLoginViewController.h"

#import "XMGRecommandViewController.h"
@interface XMGFriTrendViewController ()
@property (weak, nonatomic) IBOutlet UITextField *textField;
@end

@implementation XMGFriTrendViewController

// 点击了登录按钮
- (IBAction)clickLogin:(id)sender {
    
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"XMGLoginViewController" bundle:nil];
    
    // 加载箭头指向控制器
    XMGLoginViewController *loginVc = [storyboard instantiateInitialViewController];
    
    [self presentViewController:loginVc animated:YES completion:nil];
    
}

// 设置导航条标题字体
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor orangeColor];
    [self setupNavBar];
    
    self.textField.placeholderColor = [UIColor redColor];
    
    self.textField.placeholder = @"123";
    
}
- (void)setupNavBar
{
    // 设置导航条内容 => 栈顶控制器的navgationItem决定
    self.navigationItem.title = @"我的关注";
    
    // bug:按钮点击范围扩大
    // 不要让按钮扩大点击范围
    // 把按钮包装成UIBarButtonItem就让按钮扩大点击范围
    
    // 左边
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"friendsRecommentIcon"] highImage:[UIImage imageNamed:@"friendsRecommentIcon-click"] target:self action:@selector(recmondClick)];
    
}

- (void)recmondClick
{
    // 跳转到推荐关注控制器
    XMGRecommandViewController *recommandVc = [[XMGRecommandViewController alloc] init];
    [self.navigationController pushViewController:recommandVc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
